This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
If you want to send a message to the user, as ever with XPages there are various ways you can do it, depending on what you want.
If you want to do an alert, you basially need to trigger client-side javascript after a server-side function. That's what the onComplete event of a partial refresh is for (only available from 8.5.1). What you do in the onComplete is up to you. A basic option is to add an input field (id="saveMsg") with style="display:none" so it's accessible to CSJS but not visible to the user, then in your SSJS set the field to whatever you want to alert using getComponent("saveMsg").setValue("YOUR MESSAGE"). Your save button can then call a partial refresh with CSJS "alert(dojo.byId("#{id:saveMsg}").value)" in the onComplete event of the button.
You can get fancier using a dijit dialog and showing the dialog - bear in mind you might need to bring the dialog back inside the Form tag (google "XPages dijit dialog" for various code to do this).
If you just want to write message on the screen, you can use a computed field bound to a viewScope variable, set the viewScope variable in the SSJS and call a partial refresh of that computed field or a panel containing it.
You may also be able to do something with facesContext.getResponseWriter(). I've not used that though.
Feedback response number WEBB84PMRP created by ~Maria Xanjumiberg on 04/20/2010